package org.cupk2.tools.db.commons;

import java.util.ArrayList;
import java.util.List;

/**
 * 查询条件的封装类
 *
 *
 *
 */
public class DBRuleList {
    @SuppressWarnings("unused")
    private static final long serialVersionUID = 1L;
    private List<QueryRule> list = new ArrayList<QueryRule>();

    private DBRuleList() {
    }

    public static DBRuleList getInstance() {
        return new DBRuleList();
    }

    public DBRuleList add(DBRule rule) {
        list.add(rule);
        return this;
    }

    public DBRuleList add(SqlRule rule) {
        list.add(rule);
        return this;
    }

    public List<QueryRule> toList() {
        return list;
    }
}
